<!-- 方法一，图片过高时不会缩放 -->
<div style="display: table;width: 450px;height:350px;">
  <span style="display:table-cell;vertical-align: middle;">
    <img style="max-width:100%;max-height:100%;" src="./img/banner.jpeg" alt="">
  </span>
</div>

<!-- 方法二，图片会缩放 -->
<style>
  .box1 {
    position: relative;
    width: 100px;
    height: 100px;
  }
  .test {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
  }
</style>